package com.eastfair.pay.service;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.eastfair.boot.request.PageParams;
import com.eastfair.boot.service.SuperService;
import com.eastfair.pay.dto.PaymentPlanDTO;
import com.eastfair.pay.dto.PaymentPlanPageQuery;
import com.eastfair.pay.vo.PaymentPlanVO;
import com.eastfair.pay.entity.PaymentPlan;

import java.util.List;

/**
 * <p>
 * 业务接口
 * 付款计划
 * </p>
 *
 * @author clm
 * @date 2022-06-08
 */
public interface PaymentPlanService extends SuperService<PaymentPlan> {

    List<PaymentPlan> queryByBusinessId(Long contractId);

    /**
     * 计划付款时间范围查询未付款的付款计划.
     *
     * @param startPlanPayTime 开始时间
     * @param endPlanPayTime   结束时间
     * @return the list
     */
    List<PaymentPlanVO> listByPlanPayTime(String startPlanPayTime, String endPlanPayTime);

    void deleteById(Long planId);

    String saveOrupdate(List<PaymentPlanDTO> paymentPlanDTOs);

    Page<PaymentPlanVO> queryPage(PageParams<PaymentPlanPageQuery> params);

    void deleteByContractId(Long contractId);

    /**
     * 通过合同单号获取付款计划
     *
     * @param businessNumber
     * @return
     */
    List<PaymentPlan> queryByBusinessNumber(String businessNumber);
}
